package com.smartstate.IOC.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartstate.IOC.entity.CarbonEmissions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CarbonMapper extends BaseMapper<CarbonEmissions> {
    @Select("select * from  carbon_emissions")
    List<CarbonEmissions> getCarbonTotal();

    @Select("select sum(energyActivities) from carbon_emissions")
    Integer getEnergyActivitiesTotal();

    @Select("select sum(industrialProduction) from carbon_emissions")
    Integer getIndustrialProduction();

    @Select("select sum(wasteDisposal) from carbon_emissions")
    Integer getWasteDisposal();

    @Select("select energyActivities from carbon_emissions where dateContribution = #{s}")
    Integer getEnergyActivitiesMouthTotal(String s);

    @Select("select energyActivities from carbon_emissions where dateContribution = #{s}")
    Integer getIndustrialProductionMouthTotal(String s);

    @Select("select energyActivities from carbon_emissions where dateContribution = #{s}")
    Integer getWasteDisposalMouthTotal(String s);
}
